﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../../../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="../../../lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script> 
    <script src="../../../lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
    <script src="../../../lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
    <script src="../CustomersData.js" type="text/javascript"></script>
    <script type="text/javascript">
        var grid;
        var menu;
        var actionCustomerID;
        function itemclick(item, i)
        {
            alert(actionCustomerID + " | " + item.text);
        }

        $(function ()
        {
            menu = $.ligerMenu({ width: 120, items:
            [
            { text: '增加', click: itemclick, icon: 'add' },
            { text: '修改', click: itemclick },
            { line: true },
            { text: '查看', click: itemclick }
            ]
            });


            grid = $("#maingrid4").ligerGrid({ 
                columns: [
                { display: '主键', name: 'CustomerID', align: 'left', width: 120 },
                { display: '公司名', name: 'CompanyName', minWidth: 60 },
                { display: '联系名', name: 'ContactName', width: 50, align: 'left' }, { display: '联系名', name: 'ContactName', minWidth: 140 }, { display: '联系名', name: 'ContactName', minWidth: 140 }, { display: '联系名', name: 'ContactName', minWidth: 140 }, { display: '联系名', name: 'ContactName', minWidth: 140 },
                { display: '城市', name: 'City' }
                ], dataAction: 'server', pageSize: 30,
                data: CustomersData, sortName: 'CustomerID',
                width: '100%', height: '100%', onRClickToSelect:true,
                onContextmenu : function (parm,e)
                {
                    actionCustomerID = parm.data.CustomerID;
                    menu.show({ top: e.pageY, left: e.pageX });
                    return false;
                } 
            });
        });
        function getCheckedData()
        {
            var rows = grid.getCheckedRows();
            var str = "";
            $(rows).each(function ()
            {
                str += this.CustomerID + ",";
            });
            $.ligerDialog.alert('选择的是' + str);
        }
    </script>
</head>
<body style="padding:6px; overflow:hidden;"> 
  <form> 
    <div id="maingrid4" style="margin:0; padding:0"></div>
  </form>


  <div style="display:none;">
  
</div>
 
</body>
</html>
